package com.zmovie.framework.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zmovie.framework.domain.UserRole;
import com.zmovie.framework.service.UserRoleService;
import com.zmovie.framework.mapper.UserRoleMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lenovo
* @description 针对表【user_role】的数据库操作Service实现
* @createDate 2023-12-05 10:25:52
*/
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole>
    implements UserRoleService{

    @Override
    public List<UserRole> listUserRole(UserRole userRole) {
        LambdaQueryWrapper<UserRole> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(userRole.getName() != null, UserRole::getName, userRole.getName());
        wrapper.orderByAsc(UserRole::getId);
        return list(wrapper);
    }
}




